STEP 5: We'll be using multiple sprites, so we should make sure each sprite has its own name.

Remember, we're giving our soccerball a new variable name. The name belongs to the left of the = and should not have quotes around it.

  • Change the soccerball's name from sprite to ball.
  • In addition to making our code easier to read, giving each sprite a unique name will let us control sprites individually later!

To navigate the page using the TAB key, first press ESC to exit the code editor.

stage.set_axis(100) stage.create_grid_overlay(10, "grey") stage.set_background("soccerfield") ballx = -80 bally = random.randint(-100,100) # sprite = codesters.Sprite("image", x, y) sprite = codesters.Sprite("soccerball", ballx,bally)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)